<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
// 锁屏页面
Route::get('lock', ['uses'=> 'UserController@lock', 'as' => 'lock']);
Route::controllers([
    'auth' => 'Auth\AuthController',
    'password' => 'Auth\PasswordController',
]);

// 微信验证

Route::get('wxauthorize', 'WechatController@wxauthorize');
Route::any('wxcheck', 'WechatController@wxcheck');


Route::any('/wechat', 'WechatController@serve');

Route::group(['prefix' => '/','middleware'=>'auth'], function() {

    Route::get('/', ['uses'=>'WechatController@index', 'as'=>'/']);

    Route::get('medialist', ['uses'=>'MediaController@medialist','as'=>'medialist']);

    // 生成菜单
    Route::get('newmenu', ['uses'=> 'MenuController@newMenu', 'as'=> 'newmenu']);
    Route::any('makemenu', ['uses'=>'MenuController@makeMenu', 'as'=> 'makemenu']);
    // 菜单列表
    //Route::any('getmenu', 'MenuController@getMenu');

    Route::resource('menu', 'MenuController');

    // 上传图片
    Route::any('uploadimage', ['uses'=>'MediaController@savePic', 'as'=>'uploadimage']);

    // 获取永久素材列表
    Route::any('getMediaList', 'MediaController@getMediaList');

    // 上传图文消息
    Route::any('uploadTuwen', 'MediaController@uploadTuwen');

    // 同步图文消息
    Route::get('syncnews', ['uses'=>'MediaController@syncNews', 'as'=> 'syncnews']);

    // 同步图库
    Route::get('syncpic', ['uses'=>'MediaController@syncPic', 'as'=> 'syncpic']);

    // 删除图库图片
    Route::post('deletepic', ['uses'=>'MediaController@delPic', 'as'=> 'deletepic']);

    Route::resource('news', 'NewsController');

    // 微信样式库
    Route::get('weixinStyles', 'MediaController@weixinStyles');

    //文本输入框（iframe）
    Route::get('writeWenben', ['uses'=>'MediaController@writeWenben', 'as'=>'writeWenben']);
    //获取图片素材列表（iframe）
    Route::get('getPicList', ['uses'=>'MediaController@getPicList', 'as'=>'getPicList']);
    // 获取图文列表（iframe）
    Route::get('getNewsList', ['uses'=>'MediaController@getNewsList', 'as'=> 'getNewsList']);


    // 自动回复
    Route::resource('autoreply', 'AutoReplyController');



});

// 吐槽区：
// test route
Route::get('/tucaoba', 'TucaoController@show');
//Route::get('/tucao', 'WechatController@tucao');

Route::resource('tucao', 'TucaoController');